<?php

namespace app\admin\model;

use think\Db;
use think\Model;


class RobotUser extends Model
{

    

    

    // 表名
    protected $table = 'view_agentrobot_work_sum';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];

/*    
    //查询存储过程数据
    public function procedure_data_select($params=[],$must_param=[],$procedure_name='',$out_column=[],$in_out_column=[])
    {
        $list = [];
        if ($params && $must_param && $procedure_name){

            $set = preDealProcedureParam($params,$must_param,$out_column);
            
            //if ($in_out_column){
            //    $sql =  dealProcedureInOutColumn($in_out_column,$params);
            //    Db::query($sql);
            //}
            
            
            $sql = "call {$procedure_name}($set)";
            
            my_debug(1,'data_select call sql');
            my_debug(1,$sql);

            $selectlist = Db::query($sql);

            //my_debug(1,$selectlist);
            
            //if (is_array($list) && count($list)) {
            //    return $list;
            //}

            $rs_out = “”;
            $outcolumnlist = “”;
            if ($out_column) {
                $rs_out = preDealProcedureOutColumn($out_column);
                
                $sql = "select {$rs_out}";     
            }
            else{
                $sql = "select @_res";
            }

            $outcolumnlist = Db::query($sql);  
            $outcolumnlist = dealWithProcedureColumn($outcolumnlist,$must_param);

            if ($in_out_column){
                
                dealProcedureInOutColumn($in_out_column,$params);
                $rs_out .= preDealProcedureOutColumn($in_out_column);
            }
            $sql = "select {$rs_out}";
            else{
                $sql = "select @_res";
            }
            $outcolumnlist = Db::query($sql);
            $outcolumnlist = dealWithProcedureColumn($outcolumnlist,$must_param);

            $list['res' => $outcolumnlist, 'list' => $selectlist, ];
        }
        return $list;
    }

    //添加存储过程数据
    public function procedure_data_add($params=[],$must_param=[],$procedure_name='')
    {
        $rs = [];
        if($params && $must_param && $procedure_name){
            $set = preDealProcedureParam($params,$must_param);
            $sql = "call {$procedure_name}($set)";

            //my_debug(1,'$sql--81');
            //my_debug(1,$sql);
            $rs = Db::query($sql);

            //my_debug(1,'$rs--85');
            //my_debug(1,$rs);

            $sql = "select {$set}";
            //my_debug(1,'$sql--89');
            //my_debug(1,$sql);
            $rs = Db::query($sql);

            //my_debug(1,'$rs--93');
            //my_debug(1,$rs);
            $rs = dealWithProcedureColumn($rs,$must_param);
            if(count($rs) == 1){
                $rs = $rs[0];
            }
        }
        return $rs;
    }
    */

    







}
